package com.yichen.rent.controller;

import com.yichen.rent.service.NewhouseService;
import com.yichen.rent.service.OldhouseService;
import com.yichen.rent.service.ResourceService;
import entity.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@CrossOrigin
@RequestMapping("/search")
public class SearchController {

    @Autowired
    private OldhouseService oldhouseService;

    @Autowired
    private NewhouseService newhouseService;

    @Autowired
    private ResourceService resourceService;

    public Result search(String content,String houseType) {
        Map<String,Object> map = new HashMap<>();
        if(houseType.equals("1")) {
            map.put("house_title",content);
            oldhouseService.findSearch(map);
        }
        return null;
    }
}
